package org.jeecg.modules.demo.feign.factory;


import org.jeecg.modules.demo.feign.client.JeecgFeignDemoClient;
import org.jeecg.modules.demo.feign.fallback.JeecgFeignDemoFallback;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author qinfeng
 */
@Component
public class JeecgFeignDemoClientFactory implements FallbackFactory<JeecgFeignDemoClient> {

    @Override
    public JeecgFeignDemoClient create(Throwable throwable) {
        JeecgFeignDemoFallback fallback = new JeecgFeignDemoFallback();
        fallback.setCause(throwable);
        return fallback;
    }

}
